< previous page page_300 next page >

Page 300
Record Movement Buttons
Now lets add four command buttons where the data control was located. Youll then set a couple of properties to add arrows to each command button.
EXERCISE
Add Record Movement Command Buttons
1. Add four command buttons as shown in Figure 14.8.
2. Set all four command buttons Caption properties to blank.
3. Set all four command buttons Style properties to 1-Graphical.
4. Set the Name and Picture property of each as listed in Table 14.4.
Table 14.4 Name and Picture Properties.
NamePicture
cmdFirst<Visual Basic Path>\Graphics\Icons\Arrows\Arw06up.ico
cmdPrevious<Visual Basic Path>\Graphics\Icons\Arrows\Arw06lt.ico
cmdNext<Visual Basic Path>\Graphics\Icons\Arrows\Arw06rt.ico
cmdLast<Visual Basic Path>\Graphics\Icons\Arrows\Arw06dn.ico
analysis.gifYou will find a lot of useful graphics under your default Visual Basic installation path. In Table 14.4 you just substitute the <Visual Basic Path> with the location where you installed Visual Basic 6. I use the up arrow for the First record in the Recordset, and the down arrow for the Last record.

Now that you have the user interface drawn, lets add the code to manipulate the recordset of the data control. You need to add code to each of the four command buttons to move to the first and last records, as well as to move forward and backward through the recordset.

 
< previous page page_300 next page >

If you like this book, buy it!